import React from 'react';
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
import Login from './pages/Login';
import Register from './pages/Register';
import CustomerHome from './pages/CustomerHome';
import MerchantHome from './pages/MerchantHome';
import MerchantCustomerList from './pages/MerchantCustomerList';
import MerchantCustomerDetail from './pages/MerchantCustomerDetail';
import { ConfigProvider } from 'antd';
import zhCN from 'antd/lib/locale/zh_CN';
import 'antd/dist/antd.css';

function App() {
  return (
    <ConfigProvider locale={zhCN}>
      <Router>
        <Routes>
          <Route path="/login" element={<Login />} />
          <Route path="/register" element={<Register />} />
          <Route path="/customer" element={<CustomerHome />} />
          <Route path="/merchant" element={<MerchantHome />} />
          <Route path="/merchant/customers" element={<MerchantCustomerList />} />
          <Route path="/merchant/customer/:customerId" element={<MerchantCustomerDetail />} />
          <Route path="/" element={<Navigate to="/login" replace />} />
        </Routes>
      </Router>
    </ConfigProvider>
  );
}

export default App; 